<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!--渲染器-->
    <meta name="renderer" content="webkit">
    <!--优先使用最新版本的IE 和 Chrome 内核-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>SIYUCMS 后台管理面板</title>
    <!-- 告诉浏览器该页面是自适应布局 -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="/static/plugins/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/static/plugins/AdminLTE/bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="/static/plugins/AdminLTE/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="/static/plugins/AdminLTE/dist/css/skins/_all-skins.min.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="/static/plugins/AdminLTE/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
    <!-- Datetime Picker -->
    <link rel="stylesheet" href="/static/plugins/AdminLTE/bower_components/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="/static/plugins/AdminLTE/bower_components/bootstrap-daterangepicker/daterangepicker.css">
    <!-- Pace style -->
    <link rel="stylesheet" href="/static/plugins/AdminLTE/plugins/pace/pace.css">

    <!-- jQuery 3 -->
    <script src="/static/plugins/AdminLTE/bower_components/jquery/dist/jquery.min.js"></script>

    <!-- webuploader -->
    <link rel="stylesheet" type="text/css" href="/static/plugins/webuploader-0.1.5/webuploader.css">
    <script src="/static/plugins/webuploader-0.1.5/webuploader.js"></script>
    {include file="index/webuploader" /}

    <!-- ckeditor4 -->
    <script src="/static/plugins/ckeditor/ckeditor.js"></script>
    
    <!-- sweetalert -->
    <link rel="stylesheet" href="/static/plugins/sweetalert/dist/sweetalert2.min.css">
	<script src="/static/plugins/sweetalert/dist/sweetalert2.min.js"></script>
	<script src="/static/plugins/sweetalert/lib/es6-promise.min.js"></script>

    <!-- jQueryTagsInput -->
    <script src="/static/plugins/AdminLTE/plugins/jQueryTagsInput/jquery.tagsinput.js"></script>
    <link rel="stylesheet" href="/static/plugins/AdminLTE/plugins/jQueryTagsInput/jquery.tagsinput.css">

    <!-- SIYUCMS -->
    <link rel="stylesheet" href="/static/plugins/AdminLTE/dist/css/siyucms.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- 警告：Respond.js 不支持 file:// 方式查看（即本地方式查看）-->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <!--<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">-->
</head>
<!--
BODY TAG OPTIONS:
=================
应用以下一个或多个类以达到你想要的效果
|---------------------------------------------------------|
| SKINS         | skin-blue                               |
|               | skin-black                              |
|               | skin-purple                             |
|               | skin-yellow                             |
|               | skin-red                                |
|               | skin-green                              |
|---------------------------------------------------------|
|LAYOUT OPTIONS | fixed                                   |
|               | layout-boxed                            |
|               | layout-top-nav                          |
|               | sidebar-collapse                        |
|               | sidebar-mini                            |
|---------------------------------------------------------|
-->
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <!-- Main Header -->
    <header class="main-header">
        <!-- Logo -->
        <a href="{:url('Index/index')}" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>SIYU</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>SIYU</b> CMS</span>
        </a>
        <!-- Header Navbar -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- 切换边栏-->
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button" title="切换边栏">
                <span class="sr-only">切换边栏</span>
            </a>
            <a href="javascript:;" class="sidebar-toggle fullscreen" title="全屏模式">
                <i class="glyphicon glyphicon-fullscreen">
                </i>
            </a>
            <!-- Navbar Left Menu -->
            <ul class="nav navbar-nav js_left_menu">
                <li class="active">
                    <a href="javascript:;">
                        <i class="fa  fa-gear"></i>
                        <span>主导航</span>
                    </a>
                </li>
                <li>
                    <a href="javascript:;">
                        <i class="fa fa-th-large"></i>
                        <span>内容管理</span>
                    </a>
                </li>
            </ul>
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- User Account Menu -->
                    <li class="dropdown user user-menu">
                        <!-- Menu Toggle Button -->
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <!-- The user image in the navbar-->
                            <img src="{:session('admin.image') ? session('admin.image') : '/static/plugins/AdminLTE/dist/img/user2-160x160.jpg'}"
                                 class="user-image">
                            <!-- hidden-xs hides the username on small devices so only the image appears. -->
                            <span class="hidden-xs">{:session('admin.nickname') ? session('admin.nickname') : session('admin.username')}</span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- The user image in the menu -->
                            <li class="user-header">
                                <img src="{:session('admin.image') ? session('admin.image') : '/static/plugins/AdminLTE/dist/img/user2-160x160.jpg'}"
                                     class="img-circle">

                                <h5>
                                    上次登录时间：{:session('admin.logintime')}
                                </h5>
                                <h5>
                                    上次登录IP：{:session('admin.loginip')}
                                </h5>
                            </li>
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a href="{:url('auth/adminedit',['id'=>session('admin.id')])}"
                                       class="btn btn-default btn-flat">资料</a>
                                </div>
                                <div class="pull-right">
                                    <a href="{:url('Login/logout')}" class="btn btn-default btn-flat">退出</a>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a class="js_clear_cash" href="javascript:;" target="right" title="清空缓存">
                            <i class="glyphicon glyphicon-refresh">
                            </i>
                        </a>
                    </li>
                    <li>
                        <a href="/" target="_blank" title="访问系统前台">
                            <i class="glyphicon glyphicon-home">
                            </i>
                        </a>
                    </li>
                    <!-- Control Sidebar Toggle Button -->
                    <li>
                        <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <script>
        //主导航、内容管理切换
        $(".js_left_menu li").click(function(){
            //通过 .index()方法获取元素下标，从0开始，赋值给某个变量
            var _index = $(this).index();
            //让左侧菜单第 _index 个显示出来，其他的被隐藏
            $(".js_left_menu_show").eq(_index).show().siblings('.js_left_menu_show').hide();
            //当前菜单添加选中效果,同级的移除。
            $(this).addClass('active').siblings('li').removeClass('active');

        })

        $(".js_clear_cash").click(function() {
            var url = "{:url('index/clear')}";
            swal({
                title: '确定要清除缓存吗?',
                text: "该操作无法撤回！",
                type: 'warning',
                showCancelButton: false,
                confirmButtonText: '确定',
                cancelButtonText: '取消'
            }).then(function(isConfirm) {
                if (isConfirm) {
                    $.post(url, {
                        del: true
                    }, function(result) {
                        if (result.error == 0) {
                            swal(result.msg, '', 'success').then(function() {
                                //window.location.reload(); //传统重载
                                $.pjax.reload('.content-wrapper'); //pjax 重载
                            });
                        } else {
                            swal(result.msg, '', 'error');
                        }
                    });
                }
            })
        })

    </script>
